package edu.webarchitechture.bank.ejb3.services;

import edu.webarchitechture.bank.ejb3.domain.User;

import javax.ejb.Local;
import java.util.List;

/**
 * Local interface to expose the user manager bean.
 * 
 * @author Inoka Dissanayaka.
 */
@Local
public interface UserManager {

    /**
     * Get user by primary key.
     *
     * @param userId a Long.
     * @return user object.
     */
    User getUserById(Long userId);

    /**
     * Return all the users.
     *
     * @return List of users.
     */
    List<User> getAllUsers();

    /**
     * Save user. This method can be used to both save and update user.
     *
     * @param user a user to be saved.
     */
    void saveUser(User user);

    /**
     * Remove a particular user.
     * 
     * @param user the user to be deleted.
     */
    void removeUser(User user);
}

